def insert_sort_gap(lyst, gap):
    for i in range(gap, len(lyst), gap):
        tmp = lyst[i]
        j = i - gap
        while j >= 0 and lyst[j] > tmp:
            lyst[j+gap] = lyst[j]
            j -= gap
        lyst[j+gap] = tmp

def shell_sort(lyst):
    d = len(lyst) // 2
    while d >= 1:
        insert_sort_gap(lyst, d)
        d // 2
    